package com.example.swim.Service;


import com.example.swim.Dao.ApplyDao;
import com.example.swim.Pojo.Apply;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author LiYa
 * @create 2022-08-01 14:18
 */
@Transactional
@Service
public class ApplyService {
    @Autowired
    ApplyDao applyDao;
    public void insert(Apply apply)
    {
        applyDao.insert(apply);
        System.out.println("报名成功");
    }
    public void del(Apply apply)
    {
        applyDao.del(apply);
        System.out.println("删除成功");
    }
    public void delById(Integer id)
    {
        applyDao.delById(id);
        System.out.println("管理员成功删除id为"+id+"的报名学员");
    }
    public List<Apply> find(Integer id)
    {
        return applyDao.find(id);
    }
    public List<Apply> findAll()
    {
        return applyDao.findAll();
    }
    public void update(Apply apply)
    {
        applyDao.update(apply);
        System.out.println("修改报名信息成功");
    }
}
